<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>消息测试</title>
<link rel="stylesheet" type="text/css" href="resources/css/comm.css">
</head>
<body>
<div>
	<a href="index.html">返回</a>
	<hr>
	<div id="commonPanel"></div>
	<hr>
	<div>
		<p>获取用户分组规则的集合</p>
		<p>系统编码：<input type="text" id="sysNo" value="test"></p>
		<p>用户编号：<input type="text" id="userId" value="123456"></p>
		<p>父级编号：<input type="text" id="pid" value=""></p>
		<p>
			<input type="button" id="save" value="提交">
			<span id="msg" style="color: green;font-size: 12px;"></span>
		</p>
		<div id="list"></div>
	</div>
</div>
<script type="text/javascript" src="resources/js/jquery.min.js"></script>
<script type="text/javascript" src="resources/js/md5.js"></script>
<script type="text/javascript" src="resources/js/msg.js"></script>
<script type="text/javascript">
$(function() {
	$('#save').click(function() {
		var sysNo = $('#sysNo').val();
		var userId = $('#userId').val();
		var pid = $('#pid').val();
		api.userGroupRule.find(sysNo, userId, pid, function(json) {
			if(json.code == 0) {
				$('#msg').html('查询成功');
				var _cont = ['<table class="table"><tr><td>分组编码</td><td>分组名称</td><td>状态</td></tr>'];
				$.each(json.body, function(i, obj) {
					_cont.push('<tr><td>',obj.groupId,'</td><td>',obj.groupName,'</td><td>',obj.statusName,'</td></tr>');
				});
				_cont.push('</table>');
				$('#list').empty().append(_cont.join(''));
			} else {
				alert(json.message);
			}
		});
	});
});
</script>
</body>
</html>